package com.xdf.xzymanagementsystem.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 版本号：20240401
 * 由 chanchaw 创建于 2024-10-9 15:18:45，实现功能如下：
 * 1. 实现接口 Serializable
 * 2. 无参构造函数
 * 3. 建造者模式
 * 4. getter,setter,toString()
 * 客户、供应商上传的合同
 */
public class UploadContract implements Serializable {
    public UploadContract() {}
    private static final long serialVersionUID = 1L;

    private Integer id;//自增主键
    private Integer type;//默认0表示客户合同，1为供应商合同
    private String contactCode;//客户供应商的编号=jc_contactcompany.ct_code=jc_supplier.id
    private String filenameOriginal;//上传文件的原始名称
    private String filenameRename;//重命名后的文件名
    private String filePath;//上传的文件在服务器上的绝对路径
    private String hashString;//文件哈希值，用于判断是否同一个文件
    private Integer state;//状态，默认1有效，0作废，-1删除
    private Float seq;//排序序号，备用
    private String remark;//备注
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private java.util.Date createTime;//创建时间，DB自动填充
    private String createUser;//创建本行数据的登录系统的用户名称

    public UploadContract(Integer id, Integer type, String contactCode, String filenameOriginal, String filenameRename, String filePath, String hashString, Integer state, Float seq, String remark, Date createTime, String createUser) {
        this.id = id;
        this.type = type;
        this.contactCode = contactCode;
        this.filenameOriginal = filenameOriginal;
        this.filenameRename = filenameRename;
        this.filePath = filePath;
        this.hashString = hashString;
        this.state = state;
        this.seq = seq;
        this.remark = remark;
        this.createTime = createTime;
        this.createUser = createUser;
    }

    public Integer getId(){return this.id;}
    public void setId(Integer id){this.id = id;}
    public Integer getType(){return this.type;}
    public void setType(Integer type){this.type = type;}
    public String getContactCode(){return this.contactCode;}
    public void setContactCode(String contactCode){this.contactCode = contactCode;}
    public String getFilenameOriginal(){return this.filenameOriginal;}
    public void setFilenameOriginal(String filenameOriginal){this.filenameOriginal = filenameOriginal;}
    public String getFilenameRename(){return this.filenameRename;}
    public void setFilenameRename(String filenameRename){this.filenameRename = filenameRename;}
    public String getFilePath(){return this.filePath;}
    public void setFilePath(String filePath){this.filePath = filePath;}
    public String getHashString(){return this.hashString;}
    public void setHashString(String hashString){this.hashString = hashString;}
    public Integer getState(){return this.state;}
    public void setState(Integer state){this.state = state;}
    public Float getSeq(){return this.seq;}
    public void setSeq(Float seq){this.seq = seq;}
    public String getRemark(){return this.remark;}
    public void setRemark(String remark){this.remark = remark;}
    public java.util.Date getCreateTime(){return this.createTime;}
    public void setCreateTime(java.util.Date createTime){this.createTime = createTime;}
    public String getCreateUser(){return this.createUser;}
    public void setCreateUser(String createUser){this.createUser = createUser;}


    @Override
    public String toString() {
        return "UploadContract{" +
                ",id='" + id + '\'' +
                ",type='" + type + '\'' +
                ",contactCode='" + contactCode + '\'' +
                ",filenameOriginal='" + filenameOriginal + '\'' +
                ",filenameRename='" + filenameRename + '\'' +
                ",filePath='" + filePath + '\'' +
                ",hashString='" + hashString + '\'' +
                ",state='" + state + '\'' +
                ",seq='" + seq + '\'' +
                ",remark='" + remark + '\'' +
                ",createTime='" + createTime + '\'' +
                ",createUser='" + createUser + '\'' +
                '}';
    }

    public static class Builder{
        private Integer id;
        private Integer type;
        private String contactCode;
        private String filenameOriginal;
        private String filenameRename;
        private String filePath;
        private String hashString;
        private Integer state;
        private Float seq;
        private String remark;
        private java.util.Date createTime;
        private String createUser;

        public Builder id(Integer id){this.id = id;return this;}
        public Builder type(Integer type){this.type = type;return this;}
        public Builder contactCode(String contactCode){this.contactCode = contactCode;return this;}
        public Builder filenameOriginal(String filenameOriginal){this.filenameOriginal = filenameOriginal;return this;}
        public Builder filenameRename(String filenameRename){this.filenameRename = filenameRename;return this;}
        public Builder filePath(String filePath){this.filePath = filePath;return this;}
        public Builder hashString(String hashString){this.hashString = hashString;return this;}
        public Builder state(Integer state){this.state = state;return this;}
        public Builder seq(Float seq){this.seq = seq;return this;}
        public Builder remark(String remark){this.remark = remark;return this;}
        public Builder createTime(java.util.Date createTime){this.createTime = createTime;return this;}
        public Builder createUser(String createUser){this.createUser = createUser;return this;}
        public UploadContract build(){
            return new UploadContract(this);
        }
    }

    public static Builder builder(){return new Builder();}
    public UploadContract(Builder builder){
        this.id = builder.id;
        this.type = builder.type;
        this.contactCode = builder.contactCode;
        this.filenameOriginal = builder.filenameOriginal;
        this.filenameRename = builder.filenameRename;
        this.filePath = builder.filePath;
        this.hashString = builder.hashString;
        this.state = builder.state;
        this.seq = builder.seq;
        this.remark = builder.remark;
        this.createTime = builder.createTime;
        this.createUser = builder.createUser;
    }
    /**
     * 自定义代码请写在此处之后
     */
}
